<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
		<meta charset="utf-8">
		<title>淘天机站群系统管理后台</title>
		<!-- include header_meta -->	
</head>
<body>
	<!-- include header -->
	<div class="cp-wrap {if $jnarrow}jnarrow{/if}">
		<div class="crumb"></div>
		<div class="cp-form">
			<div class="box">
				<div class="box-title">添加采集规则</div>
				<form method="POST" class="AjaxPost">

					<div class="control-group" >
						<label class="control-label">作用范围：</label>
						<div class="controls controls-row">
							<label><input type="radio" id="s1" name="v[scope]" value="{$currentYuming[id]}"  {if $res[yuming_id]==$currentYuming[id]}checked='checked'{/if} > 当前选择站点</label>
							<label><input type="radio" id="s2" name="v[scope]" value="0"  {if $res[yuming_id]==0}checked='checked'{/if}>用于所有站点（随机采入一个站点）</label>
						</div>
					</div>

					<div class="control-group" id="classbox" {if $res[yuming_id]==0} style="display: none;" {/if}>
						<label class="control-label" for="name">指定到栏目：</label>
						<div class="controls controls-row">
							<!-- if $classlist -->
							<select name="v[class]">
								<option value="">随机栏目</option>
								<!-- foreach $classlist $v -->
								<option value="{$v[ename]}" {if $v['ename']==$res['class']} selected="selected" {/if}>{$v[title]}</option>
								<!-- /foreach -->
							</select>
							<!-- else -->
							<input type="hide" name="v[class]">
							随机栏目
							<!-- /if -->
						</div>
					</div>

					<div class="control-group">
						<label class="control-label" for="name">列表网址：</label>
						<div class="controls controls-row">
							<input type="text" class="input-small focused" name="v[listurl]" value="{$res[listurl]}"  placeholder="如：http://example.com/list_[1-10].html" style="width:400px;">
							<span class="tip">要采集的栏目列表，通配符[开始数-结束数]，如[1-10]</span>
						</div>
					</div>

					<div class="control-group">
						<label class="control-label" for="name">[规则说明]：</label>
						<div class="controls controls-row">
							<span class="tip">找出字段内容所在区域，"起始html片段[内容]结尾html片段"，如标题规则：&lttitle&gt[内容]_国内新闻</span>
						</div>
					</div>

					<div class="control-group">
						<label >
							<label class="control-label" for="name">文章网址区域：</label>
							<div class="controls controls-row">
								<textarea name="v[articlerule]" style="width:400px;height:150px;"  placeholder="开始[内容]结束">{$res[articlerule]}</textarea>
							</div>
						</label>

						<label >
							<label class="control-label" for="name">网址过滤：</label>
							<textarea name="v[norule]" style="width:400px;height:150px;"  placeholder="多个规则用换行隔开">{$res[norule]}</textarea>	
						</label>
					</div>

					<div class="control-group">
						<label >
							<label class="control-label" for="name">标题规则：</label>
							<div class="controls controls-row">
								<textarea name="v[titlerule]" style="width:400px;height:150px;">{$res[titlerule]}</textarea>
							</div>
						</label>
					</div>

					<div class="control-group">
						<label >
							<label class="control-label" for="name">正文规则：</label>
							<div class="controls controls-row">
								<textarea name="v[contentrule]" style="width:400px;height:150px;">{$res[contentrule]}</textarea>
							</div>
						</label>
					</div>
					<div class="form-actions">
						<button type="submit" class="btn" >保存</button>
						<button type="button" class="btn btn-link" onclick="history.back(-1)" >返回</button>
					</div>
				</form>	
			</div>
		</div>
	</div>
	<!-- include footer -->
	<style>
		.cp-form .controls span.uploadify-button-text{ padding-top:0; color: #FFF; }
	</style>
	<script type="text/javascript">
		$(function() {
			$("#s1").click(function() {
				$("#classbox").show();
			});
			$("#s2").click(function() {
				$("#classbox").hide();
			});
		})
	</script>
</body>
</html>